package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BizSalesOrderMapper;
import com.ruoyi.system.domain.BizSalesOrder;
import com.ruoyi.system.service.IBizSalesOrderService;
import com.ruoyi.common.core.text.Convert;

/**
 * 销售订单主Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-18
 */
@Service
public class BizSalesOrderServiceImpl implements IBizSalesOrderService 
{
    @Autowired
    private BizSalesOrderMapper bizSalesOrderMapper;

    /**
     * 查询销售订单主
     * 
     * @param orderId 销售订单主主键
     * @return 销售订单主
     */
    @Override
    public BizSalesOrder selectBizSalesOrderByOrderId(Long orderId)
    {
        return bizSalesOrderMapper.selectBizSalesOrderByOrderId(orderId);
    }

    /**
     * 查询销售订单主列表
     * 
     * @param bizSalesOrder 销售订单主
     * @return 销售订单主
     */
    @Override
    public List<BizSalesOrder> selectBizSalesOrderList(BizSalesOrder bizSalesOrder)
    {
        return bizSalesOrderMapper.selectBizSalesOrderList(bizSalesOrder);
    }

    /**
     * 新增销售订单主
     * 
     * @param bizSalesOrder 销售订单主
     * @return 结果
     */
    @Override
    public int insertBizSalesOrder(BizSalesOrder bizSalesOrder)
    {
        bizSalesOrder.setCreateTime(DateUtils.getNowDate());
        return bizSalesOrderMapper.insertBizSalesOrder(bizSalesOrder);
    }

    /**
     * 修改销售订单主
     * 
     * @param bizSalesOrder 销售订单主
     * @return 结果
     */
    @Override
    public int updateBizSalesOrder(BizSalesOrder bizSalesOrder)
    {
        bizSalesOrder.setUpdateTime(DateUtils.getNowDate());
        return bizSalesOrderMapper.updateBizSalesOrder(bizSalesOrder);
    }

    /**
     * 批量删除销售订单主
     * 
     * @param orderIds 需要删除的销售订单主主键
     * @return 结果
     */
    @Override
    public int deleteBizSalesOrderByOrderIds(String orderIds)
    {
        return bizSalesOrderMapper.deleteBizSalesOrderByOrderIds(Convert.toStrArray(orderIds));
    }

    /**
     * 删除销售订单主信息
     * 
     * @param orderId 销售订单主主键
     * @return 结果
     */
    @Override
    public int deleteBizSalesOrderByOrderId(Long orderId)
    {
        return bizSalesOrderMapper.deleteBizSalesOrderByOrderId(orderId);
    }
}
